package com.cjm.one.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cjm.one.model.system.dto.SysDictDataDto;
import com.cjm.one.system.mapper.SysDictDataMapper;
import com.cjm.one.system.service.SysDictDataService;
import com.cjm.one.model.system.entity.SysDictData;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
* @author 29289
* @description 针对表【sys_dict_data(字典数据表)】的数据库操作Service实现
* @createDate 2024-09-05 16:21:13
*/
@Service
public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData>
    implements SysDictDataService {
    @Resource
    private SysDictDataMapper sysDictDataMapper;

    @Override
    public Page<SysDictData> getPage(SysDictDataDto sysDictDataDto) {
        Page<SysDictData> SysDictDataPage = new Page<>(sysDictDataDto.getCurrent(), sysDictDataDto.getSize());
        LambdaQueryWrapper<SysDictData> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysDictData::getDictType, sysDictDataDto.getDictTypeKey());
        Page<SysDictData> sysDictDataPage = sysDictDataMapper.selectPage(SysDictDataPage, queryWrapper);
        return sysDictDataPage;
    }
}




